home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
UpTime Volume 2 #6
/
utv2n6s1.d64
/
adding decimals
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-28
|
13KB
|
395 lines
1 if a=0 then a=1:load"chr v2",8,1
2 if a=1 then a=2:load"vision",8,1
3 poke 56,104:clr
5 rem *** adding decimals ***
9 poke 53265,peek(53265) and 239
10 poke 53280,0:poke 53281,0
11 poke 53272,(peek(53272)and 15)or 176
12 poke 56576,(peek(56576)and252)or 2
13 poke 53272,(peek(53272)and 240)or 12
14 poke 648,108:print"[147]";:poke 53265,peek(53265) or 16
15 poke 28664,160:poke 28665,161
16 for z=54272 to 54296:poke z,.:next
17 gosub 3500:poke 198,0
18 get a$:if a$<>" " then 18
19 gn$="[193]dding [196]ecimals"
20 for z=54272 to 54296:poke z,.:next:ford=1to6:readre$(d):next
25 data "[199]reat!","[198]antastic!","[211]uper!","[217]ou've got it!"
26 data "[217]es! [217]es! [217]es!","[212]hat's [199]reat!"
28 forx=0to7:reada:poke30936+x,a:poke31056+x,peek(29320+x):next
30 data 0,128,192,224,240,224,192,128
32 forx=0to15:reada:poke30944+x,a:next
34 data 255,127,63,31,15,31,63,127,255,254,252,248,240,248,252,254
50 dimnm$(15):ford=0to10:readnm$(d):next
52 data "[172][192][187][157][157][157][221] [221][157][157][157][188][192][190]"
54 data " [174][157][221][157][157] [177] "
56 data "[172][192][187][157][157][157][172][192][190][157][157][157][173][192][189]"
58 data "[172][192][187][157][157][192][179][157][157][157][188][192][190]"
60 data "[174][157][173][219][157][177]"
62 data "[176][192][187][157][157][157][173][192][187][157][157][157][173][192][190]"
64 data"[172][192][187][157][157][157][171][192][187][157][157][157][188][192][190]"
66 data"[176][192][174][157][157][172][190][157][157][177]"
68 data"[172][192][187][157][157][157][171][192][179][157][157][157][188][192][190]"
70 data"[172][192][187][157][157][157][188][192][179][157][157][157][188][192][190]"
74 data"[223][169][146][157][157]\][157][157][169][223]"
80 fora=6to2step-1:readpl$(a):nexta
85 data "thousandths","hundredths","tenths","","ones"
95 goto 2000
100 rem *** zippy titles ***
105 rem ln=line# to place text
110 poke646,11:letlc=(23-ln)/3
115 tb=(40-len(tx$))/2
120 ford=23tolnstep-1:print"";
125 ford1=1tod:print"";:nextd1
130 ifd/6=int(d/6)then gosub165
135 printtab(tb)tx$
140 nextd
145 ford=23toln+1step-1:print"";
150 ford1=1tod:print"";:next
155 printtab(11)" "
160 next:return
165 ifpeek(646)=15thenpoke646,1
170 ifpeek(646)=12thenpoke646,15
175 ifpeek(646)=11thenpoke646,12
180 return
200 rem *** clear ***
210 for er=lnto24:poke 781,er:sys 59903:next:return
300 rem
305 rem *** reward sound ***
310 rem
320 poke 53280,2:poke 53281,2
325 s=54272:pokes+24,7:pokes+1,110:pokes+5,9:pokes+6,10:pokes+4,17:pokes+4,16
330 for d=1 to 25:next
332 poke 53280,5:poke 53281,5
335 s=54279:pokes+24,7:pokes+1,110:pokes+5,9:pokes+6,10:pokes+4,17:pokes+4,16
340 for d=1 to 25:next
342 poke 53280,6:poke 53281,6
345 s=54286:pokes+24,7:pokes+1,110:pokes+5,9:pokes+6,10:pokes+4,17:pokes+4,16
350 for d=1 to 25:next
352 poke 53280,0:poke 53281,0
355 sc=sc+1
365 return
405 rem *** get numeric input from ***
410 rem *** user for use in ***
415 rem *** working problem ***
420 rem
425 open1,0:input#1,j$:close1,0
430 j=val(j$)
435 return
480 rem *** print screen header ***
481 print"[147]":poke53287,2:poke53288,12:poke53248,40:poke53249,56:poke 53250,40
482 poke 53251,56
485 forx=0to1:poke53277,peek(53277)or(2^x):poke 53271,peek(53271)or(2^x)
490 poke 53269,peek(53269)or(2^x):nextx
495 return
499 forx=0to2:poke53269,peek(53269)and(255-2^x):nextx:return
500 rem ** short wrong sound **
505 n$="028":s=54272:pokes+6,96:pokes+24,15
510 forq=1to6 step3
515 pokes+1,val(mid$(n$,q,2)):pokes+4,33
520 forjw=1tot*val(mid$(n$,q+2,1)):next:forr=1to100:next
525 pokes+4,0:next:return
600 rem
605 rem *** general purpose delay ***
610 rem
615 for d=1 to 1300:next
620 return
625 return
800 rem *** title box ***
805 print"";
810 print"[159][192][157][157][156][183][183][145][145]";
815 forx=1to23:print"[154][175][157][159][192][157][156][183][145][145]";:next
820 print"[154][175][175][157][157][159][192]":return
850 print"[154]";:goto 855
851 print"[150]";
855 print"";
860 print" [172][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][187]"
865 forjw=1to3:print" [221][221]":next
870 print" [188][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][190]"
880 return
900 print"";:ford=1to24:print"";:next
905 print"[159][169][208]ress [210][197][212][213][210][206] to [195]ontinue or _ to [197]xit[146][169][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][145][145][145]"
925 s=54272:pokes+24,7:pokes+1,110:pokes+5,9:pokes+6,10:pokes+4,17:pokes+4,16
927 poke 198,0
930 getrc$:ifrc$=""then930
940 ifrc$="_"thencp=cp+1:goto 4000
950 ifrc$<>chr$(13)then930
960 return
980 print"";:forjg=1toy:print"";:nextjg:printtab(x);tx$;:return
990 x=(40-len(tx$))/2:goto980
1100 rem *** wrong sound ***
1105 n$="042034":s=54272:pokes+6,96:pokes+24,15
1110 forq=1to6 step3
1115 pokes+1,val(mid$(n$,q,2)):pokes+4,33
1120 forjw=1tot*val(mid$(n$,q+2,1)):next:forr=1to300:nextr
1125 pokes+4,0:nextq:return
1200 rem *** change color of number ***
1205 co=3:goto 1215
1210 co=1
1215 b1=55296:b2=b1+x+(y*40)
1220 forr=1to3:forq=0to2:pokeb2+q,co:nextq:b2=b2+40:nextr:return
1300 rem *** place number at x,y ***
1305 nu$=str$(nu):foraa=1tolen(nu$)
1310 tp$=mid$(nu$,aa,1):iftp$=" "then1325
1315 iftp$="."thentx$="*":y=y+2:gosub980:y=y-2:x=x+1:goto1325
1320 tx$=nm$(val(tp$)):gosub980:x=x+3
1325 nextaa:return
1400 rem *** place number slowly ***
1404 nu$=str$(nu)
1405 xx=x:print"[159]";:foraa=len(nu$)to1step-1
1410 tp$=mid$(nu$,aa,1):iftp$=" "then1425
1415 iftp$="."thentx$="*":x=x+2:y=y+2:gosub980:y=y-2:x=x-3:goto1422
1420 tx$=nm$(val(tp$)):gosub980:x=x-3
1422 fordd=1to300:nextdd
1425 nextaa:fordd=1to300:nextdd
1430 forx=xxto(xx-(3*len(nu$)))step-3:gosub1210:next:print"";:return
1500 rem *** option 2 input routine ***
1504 nu$=str$(nu)
1505 ot$="":fortp=len(nu$)to2step-1:wa=0
1507 poke 198,0
1510 geta$:ifa$=""thentx$="[159][176][192][174][157][157][157][221] [221][157][157][157][173][192][189]":gosub980
1511 ifa$=""thentx$=" [157][157][157] [157][157][157] ":gosub980:goto 1510
1512 a=val(a$):ifmid$(nu$,tp,1)="."anda$<>"."andop=3then1510
1513 ifa$="."then1517
1515 ifa<0ora>9then1510
1516 ifop=3then1526
1517 ifa$=mid$(nu$,tp,1)then1525
1518 gosub500:wa=wa+1:ifwa=3then1525
1520 goto 1510
1525 ifa$="."thentx$="*":y=y+2:x=x+2:gosub980:x=x-3:y=y-2:goto1527
1526 ifa$<>"."andop=2thentx$=nm$(val(mid$(nu$,tp,1))):gosub980:x=x-3
1527 ifa$<>"."andop=3thentx$=nm$(val(a$)):gosub980:x=x-3
1528 ax=x:ay=y:iftp=len(nu$)andcn$<>""thentx$=cn$:x=30:y=5:gosub980:cn$=""
1529 x=ax:y=ay
1530 ot$=a$+ot$:next:return
2000 rem
2005 rem *** main program ***
2010 rem
2015 print"[147]";:gosub480:ln=1:tx$="[193]dding [196]ecimals":gosub 100:gosub800
2020 x=0:y=10
2025 tx$="[196]o you want instructions? [145][164][164][164][164][164][157][157][157][157][157][165][217]/[206][167][157][157][157][157][157][163][163][163][163][163][145] "
2027 tx$=tx$+" [157][157][157][157][157][157][157]":gosub 980
2030 mx=1:gosub3000:i$=t$:ifi$="y"thengosub30000
2035 ifi$<>"n"andi$<>"y"thenprint"[145]";:goto2025
2038 ln=5:gosub200
2040 y=10:x=0:tx$="[215]hat is your name? "
2045 gosub 980:mx=16:gosub 3000:nn$=t$:gosub200
2050 x=0:y=10:tx$="[215]hich option do you want:"
2053 gosub 980
2055 tx$=" 1. [196]emonstration.":y=12:gosub980
2060 tx$=" 2. [215]ork [197]xamples with [200]elp.":y=13:gosub980
2065 tx$=" 3. [211]tep-by-[211]tep [208]roblems.":y=14:gosub980
2068 tx$=" 4. [193]nswers [207]nly.":y=15:gosub980
2069 tx$="[217]our choice? [145][164][164][164][164][164][157][157][157][157][157][165]1-4[167][157][157][157][157][157][163][163][163][163][163][145] ":y=17
2070 gosub980:mx=1:gosub3000
2071 op=val(t$):ifop>1thennp$="[145][164][164][164][164][164][164][157][157][157][157][157][157][165]5-20[167][157][157][157][157][157][157][163][163][163][163][163][163][145] ":